{include file="public/header" /}



<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>{$Think.lang.ds_chatlog}</h3>
                <h5></h5>
            </div>
            {include file="public/admin_items" /}
        </div>
    </div>


    <form method="get" action="" name="formSearch" id="formSearch">
        <div class="ds-search-form">
            <dl>
                <dt>{$Think.lang.chatlog_f_name}</dt>
                <dd><input type="text" class="text" name="f_name" value="{$Request.get.f_name}" /></dd>
            </dl>
            <dl>
                <dt>{$Think.lang.chatlog_t_name}</dt>
                <dd><input type="text" class="text" name="t_name" value="{$Request.get.t_name}" /></dd>
            </dl>
            <dl>
                <dt>{$Think.lang.chatlog_start_to_stop_time}</dt>
                <dd>
                    <input class="txt date" type="text" value="{$final_time_from}" id="add_time_from" name="add_time_from">
                    ~
                    <input class="txt date" type="text" value="{$final_time_to}" id="add_time_to" name="add_time_to"/>
                </dd>
            </dl>
            <div class="btn_group">
                <a href="javascript:document.formSearch.submit();" class="btn " title="{$Think.lang.ds_query}">{$Think.lang.ds_query}</a>
                <a href="{:url('Chatlog/chatlog')}" class="btn btn-default" title="{$Think.lang.ds_cancel}">{$Think.lang.ds_cancel}</a>
            </div>
        </div>
    </form>
    
    <div class="explanation" id="explanation">
        <div class="title" id="checkZoom">
            <h4 title="{$Think.lang.ds_explanation_tip}">{$Think.lang.ds_explanation}</h4>
            <span id="explanationZoom" title="{$Think.lang.ds_explanation_close}" class="arrow"></span>
        </div>
        <ul>
            <li>{$Think.lang.chatlog_index_help1}</li>
            <li>{$Think.lang.chatlog_index_help2}</li>
            <li>{$Think.lang.chatlog_index_help3}“{$minDate}”{$Think.lang.chatlog_index_help4}“{$maxDate}”{$Think.lang.chatlog_index_help5}。</li>
        </ul>
    </div>
    

    <div class="chat-log">
        <ul class="chat-log-list">
            {notempty name="log_list"}
            {foreach name="log_list" item="val"}
            {if $val.f_id == $f_member.member_id}
            <li class="from_log"><span class="avatar"><img src="{:get_member_avatar_for_id($val.f_id)}"/></span>
               {if $f_member.store_id > 0}
                <dl>
                    <dt class="store_log">{$f_member.store_name}{$Think.lang.chatlog_consult}：{$f_member.seller_name} <span>({$Think.lang.ds_member}ID：{$val.f_name})</span>
                    </dt>
                    <dd class="time">{:date('Y-m-d H:i:s',$val.chatlog_addtime)}</dd>
                    <dd class="content">{:parsesmiles($val.t_msg)}</dd>
                </dl>
                {else /}
                <dl>
                    <dt class="user_log">{$Think.lang.ds_member}：{$val.f_name}</dt>
                    <dd class="time">{:date('Y-m-d H:i:s',$val.chatlog_addtime)}</dd>
                    <dd class="content">{:parsesmiles($val.t_msg)}</dd>
                </dl>
               {/if}
            </li>
            {else /}
            <li class="to_log"><span class="avatar"><img src="{:get_member_avatar_for_id($val.f_id)}"/></span>
                {if $t_member.store_id >0}
                <dl>
                    <dt class="store_log">{$t_member.store_name}{$Think.lang.chatlog_consult}：{$t_member.seller_name} <span>({$Think.lang.ds_member}ID：{$val.f_name})</span>
                    </dt>
                    <dd class="time">{:date('Y-m-d H:i:s',$val.chatlog_addtime)}</dd>
                    <dd class="content">{:parsesmiles($val.t_msg)}</dd>
                </dl>
                {else /}
                <dl>
                    <dt class="user_log">{$Think.lang.ds_member}：{$val.f_name}</dt>
                    <dd class="time">{:date('Y-m-d H:i:s',$val.chatlog_addtime)}</dd>
                    <dd class="content">{:parsesmiles($val.t_msg)}</dd>
                </dl>
                {/if}
            </li>
           {/if}
           {/foreach}
            {else /}
             <li class="no_data">
                <td colspan="15">{$Think.lang.ds_no_record}</td>
            </li>
           {/notempty}
        </ul>
        {notempty name="log_list"}
        {$show_page|raw}
        {/notempty}
    </div>
</div>
<link rel="stylesheet" href="{$Think.CHAT_SITE_URL}/css/chat.css">
<script type="text/javascript">
    $(function(){
        $('#add_time_from').datepicker({dateFormat: 'yy-mm-dd',minDate: '{$minDate}'});
        $('#add_time_to').datepicker({dateFormat: 'yy-mm-dd',maxDate: '{$maxDate}'});
    });
</script>